-- event center
Class = require('class')

local eventcenter = Class
{
	__events = {},
	bind = function(self, event_name, handler_func)
		self.__events[event_name] = handler_func
	end,
	trigger = function(self, event_name, ...)
		local func = self.__events[event_name]
		if func == nil then
			print("Warning: trigger unbind event: "..event_name)
		else
			func(...)
		end
	end,
}

return eventcenter

